package com.apinoo.users.dao;

import java.util.List;

import org.apache.log4j.Logger;
import org.hibernate.SessionFactory;

import com.apinoo.users.domain.Group;
import com.apinoo.users.domain.User;
import com.apinoo.users.dto.GroupDTO;

public class GroupDAOImpl implements GroupDAO {
	
	private Logger logger = Logger.getLogger(getClass());
	
	private SessionFactory sessionFactory;

	public void setSessionFactory(SessionFactory sessionFactory) {
		this.sessionFactory = sessionFactory;
	}

	@Override
	public void addGroup(GroupDTO dto) {
		Group g = dto.getGroup();
		logger.debug("Group: "+ g.toString());
		
		
	}

	@Override
	public void updateGroup(GroupDTO dto) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void deleteGroup(GroupDTO dto) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public List<GroupDTO> getGroups(GroupDTO dto) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public int countGroups(GroupDTO dto) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public Group getGroupById(long id) {
		Group group = (Group) this.sessionFactory.getCurrentSession()
				.get(Group.class, id);
		
		return group;
	}

	@Override
	public Group getUserByName(String name) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public boolean groupNameExists(GroupDTO dto) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean authorityExists(GroupDTO dto) {
		// TODO Auto-generated method stub
		return false;
	}

}
